using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSRI.HelperClasses;
using Instedd.Labs.Geo.Library.Kml;
using Mvp.Xml.Common.Xsl;
using System.Xml;
using System.IO;
using System.Xml.Xsl;
using System.Collections.Specialized;
using Instedd.Labs.Geo.Library.Sms;

namespace Instedd.Labs.Geo.Library.Tests.Managers
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class BubbleDescriptionGeneratorFixture
    {
        public BubbleDescriptionGeneratorFixture()
        {
        }

        [TestMethod]
        public void ValidLinkTemplateReturnsFormattedAnswerLink()
        {
            string replyLinkTemplate = @"http://localhost:51424/SMS.VE.Host.Web/AnswerSMS.aspx?SenderName={0}&amp;Message={1}&amp;Number={2}&amp;MessageId={3}";

            SmsExtension message = new SmsExtension(new SmsClass(), new LatLong(12.22, 33.44), "Message description", "Tom", "444");
            message.Sms.Number = "4444-5555";
            message.Sms.MessageID = new Guid("5a8fa480-0d36-42f6-8709-e15264a3dd98");

            Assert.AreEqual(" <a href=\"http://localhost:51424/SMS.VE.Host.Web/AnswerSMS.aspx?SenderName=Tom&amp;Message=Message description&amp;Number=4444-5555&amp;MessageId=5a8fa480-0d36-42f6-8709-e15264a3dd98\">Reply</a>", BubbleDescriptionGenerator.GenerateReplyLink(message, replyLinkTemplate));
        }

        [TestMethod]
        public void NullLinkTemplateReturnEmptyAnswerLink()
        {
            string replyLinkTemplate = null;

            SmsExtension message = new SmsExtension(new SmsClass(), new LatLong(12.22, 33.44), "Message description", "Tom", "444");

            Assert.AreEqual(string.Empty, BubbleDescriptionGenerator.GenerateReplyLink(message, replyLinkTemplate));
        }

        [TestMethod]
        public void EmptyLinkTemplateReturnEmptyAnswerLink()
        {
            string replyLinkTemplate = string.Empty;

            SmsExtension message = new SmsExtension(new SmsClass(), new LatLong(12.22, 33.44), "Message description", "Tom", "444");

            Assert.AreEqual(string.Empty, BubbleDescriptionGenerator.GenerateReplyLink(message, replyLinkTemplate));
        }
    }
}